<?php

namespace app\common\service;


use app\common\exception\ApiException;

class ManagerToken extends BaseToken {
    public static function saveToCache($value) {
        $key             = self::generateToken();
        $token_expert_in = config('setting.token_expire_in');
        $result          = cache($key, json_encode($value), $token_expert_in);
        if (!$result) {
            throw new ApiException('服务器错误', 500);
        }
        return $key;
    }
}